<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>器械采购计划</title>
<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/icon.css"/>">
<script type="text/javascript" src="<c:url value="/js/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/easyui-lang-zh_CN.js"/>"></script>
<style>
* {
	font-size: 12px;
}
.item{
		margin-top: 5px;
	}
</style>
</head>
<body>
	<script type="text/javascript">
		$(function(){
			//单击"制定采购计划按钮"打开win_addequprcplan窗口
			$("#equprcplan-add").linkbutton({
				onClick : function() {
					$("#win_addequprcplan").window("open")
				}
			});
			//单击窗口"btn_close"按钮关闭窗口
			$("#btn_close").linkbutton({
				onClick : function() {
					$("#win_addequprcplan").window("close")
				}
			});
			//重置form_addequprcplan表单
			$("#btn_reset").linkbutton({onClick : function(){
				var equas=$("#equas").combobox('getValue');
				if(equas == '未审批' || equas == '待审批'){
					$("#equa").combobox("enable");
					$("#equat").datebox("enable");
				}
				$("#form_addequprcplan").form("reset").clear;
			}});
			//提交"form_addequprcplan"表单
			$("#btn_true").linkbutton({onClick : function() {
				$("#form_addequprcplan").form('submit', {
					onSubmit : function() {
					},
					success : function(data) {
						var json = eval("(" + data + ")");
						$.messager.alert("提示", json.reason);
						//关闭窗口
						$('#win_addequprcplan').window('close');
						//重新加载数据
						$("#tb_equprcplan").datagrid("reload");
						$(this).form("clear");
					}
				});
			}});
			
			//制定窗口审批状态禁用 
			$("#equas").combobox({onChange:function(record){
				 var equas = $('#equas').combobox('getValue'); 
					if(equas == "未审批" || equas == "待审批"){
						$("#equa").combogrid("disable"); 
						$("#equat").datebox("disable"); 
					}else if(equas == "已审批"){
						$("#equa").combogrid("enable");
						$("#equat").datebox("enable");
					}
				}
				
			}); 
			
			//制定窗口状态禁用
			$("#equps").combobox({onChange:function(record){
				var equps = $("#equps").combobox('getValue'); 
					if(equps == "未制定"){
							$("#equtitle").textbox('disable');
							$("#equname").textbox('disable');
							$("#equas").combobox('disable');
							$("#equat").datebox('disable');
							$("#equa").combobox('disable');
							$("#equad").datebox('disable');
							$("#equpeo").combobox('disable');
							$("#equst").datebox('disable');
							$('#btn_true').linkbutton('disable');
							$('#btn_reset').linkbutton('disable');
					}else if(equps == "已制定"){
						$("#equas").combobox('enable');
						$("#equa").combobox("enable");
						$("#equat").datebox("enable");
						$("#equtitle").textbox("enable");
						$("#equname").textbox('enable');
						$("#equad").datebox("enable");
						$("#equpeo").combobox("enable");
						$("#equst").datebox("enable");
						$('#btn_true').linkbutton('enable');
						$('#btn_reset').linkbutton('enable');
						var equas = $("#equas").combobox('getValue');
						if(equas == '未审批' || equas == '待审批'){
							$("#equas").combobox('clear');
							$("#equas").combobox('enable');
							$("#equa").combobox("enable");
							$("#equat").datebox("enable");
							$("#equtitle").textbox("enable");
							$("#equname").textbox('enable');
							$("#equad").datebox("enable");
							$("#equpeo").combobox("enable");
							$("#equst").datebox("enable");
							$('#btn_true').linkbutton('enable');
							$('#btn_reset').linkbutton('enable');
						}
							
					}
				}
			});
			// 表单提交验证equtitle equname
			/* $("#btn_true").linkbutton({onClick:function(){
				var equtitle = $("#equtitle").textbox('getValue');
				var equname = $("#equname").textbox('getValue');
				var equas = $("#equas").combobox('getValue');
				var equat = $("#equat").datebox('getValue');
				var equa = $("#equa").combobox('getValue');
				var equad = $("#equad").datebox('getValue');
				var equpeo = $("#equpeo").combobox('getValue');
				var equps = $("#equps").combobox('getValue');
				var equst = $("#equst").datebox('getValue');
					if(equtitle ==  null|| equname == null || equas == null || equat == null || equa == null || equad == null || equpeo == null || equps == null || equst == null){
						$("#btn_true").linkbutton('disable');
					}
				}
			}); */
			/*  $("#form_addequprcplan").form('submit',{onSubmit:function(){
						var equas = $("#equas").combobox('getValue');
						var equat = $("#equat").datebox('getValue');
						var equa = $("#equa").combobox('getValue');
						var equad = $("#equad").datebox('getValue');
						var equpeo = $("#equpeo").combobox('getValue');
						var equps = $("#equps").combobox('getValue');
						var equst = $("#equst").datebox('getValue');
						if(equas == null || equat == null || equa == null || equad == null || equpeo == null || equps == null || equst == null) {
							
						}
					 	
				 },
				 
			});  */
			
			//单击"修改采购计划按钮"打开win_editequprcplan窗口
			$("#equprcplan-edit").linkbutton({
				onClick : function() {
					$("#win_editequprcplan").window("open")
				}
			});
			//单击窗口"edit_close"按钮关闭窗口
			$("#edit_close").linkbutton({
				onClick : function() {
					$("#win_editequprcplan").window("close")
				}
			});
			//重置form_editequprcplan表单
			$("#edit_reset").linkbutton({onClick : function(){
				var editequas=$("#editequas").combobox('getValue');
				if(editequas == '未审批' || editequas == '待审批'){
					$("#editequa").combobox("enable");
					$("#editequat").datebox("enable");
				}
				$("#form_editequprcplan").form("reset").clear;
				
			}});
			
			//修改窗口审批状态禁用 
			$("#editequas").combobox({
				onChange:function(record){
				 var editequas = $('#editequas').combobox('getValue'); 
					if(editequas == "未审批" || editequas == "待审批"){
						$("#editequa").combogrid("disable"); 
						$("#editequat").datebox("disable"); 
						$("#editequa").combogrid("clear"); 
						$("#editequat").datebox("clear"); 
					}else if(editequas == "已审批"){
						$("#editequa").combogrid("enable");
						$("#editequat").datebox("enable");
					}
				}
				
			}); 
			//修改窗口状态禁用
			$("#editequps").combobox({onChange:function(record){
				var editequps = $("#editequps").combobox('getValue');
				var editequas = $("#editequas").combobox('getValue');
					if(editequps == "未制定"){
							$("#editequtitle").textbox('disable');
							$("#editequname").textbox('disable');
							$("#editequas").combobox('disable');
							$("#editequat").datebox('disable');
							$("#editequa").combobox('disable');
							$("#editequad").datebox('disable');
							$("#editequpeo").combobox('disable');
							$("#editequst").datebox('disable');
							$('#edit_true').linkbutton('disable');
							$('#edit_reset').linkbutton('disable');
					}else if(editequps == "已制定"){
							$("#editequas").combobox('enable');
							$("#editequa").combobox('enable');
							$("#editequat").datebox('enable');
							$("#editequtitle").textbox("enable");
							$("#editequname").textbox('enable');
							$("#editequad").datebox('enable');
							$("#editequpeo").combobox('enable');
							$("#editequst").datebox('enable');
							$('#edit_true').linkbutton('enable');
							$('#edit_reset').linkbutton('enable');
						}
				}
			});
			//提交"form_editequprcplan"表单
			$("#edit_true").linkbutton({onClick : function() {
				$("#form_editequprcplan").form('submit', {
					onSubmit : function() {
					},
					success : function(data) {
						var json = eval("(" + data + ")");
						$.messager.alert("提示", json.reason);
						//关闭窗口
						$('#win_editequprcplan').window('close');
						//重新加载数据
						$("#tb_equprcplan").datagrid("reload");
						$(this).form("clear");
					}
				});
			}});
			
			//修改采购计划表
			$("#equprcplan-edit").linkbutton({onClick:function(){
				//获取选中行的行数
				var rows = $("#tb_equprcplan").datagrid("getSelections");
				if(rows.length == 1){
					$("#win_editequprcplan").window({'title':"编辑采购计划表"});
					$("#win_editequprcplan").window("open");
					
					//初始化表单
					var editequas = $('#editequas').combobox('getValue'); 
					if(editequas == "未审批" || editequas == "待审批"){
						$("#editequa").combogrid("disable"); 
						$("#editequat").datebox("disable"); 
					}else if(editequas == "已审批"){
						$("#editequa").combogrid("enable");
						$("#editequat").datebox("enable");
					}
					var equPrcPlanId = rows[0].equPrcPlanId;
					$.getJSON("findequPrcPlanByequPrcPlanId", {"equPrcPlanId": equPrcPlanId}, function(data){
						$("#form_editequprcplan").form("load", data);
					});
				}else{
					$.messager.alert("提示", "只能选择一条记录，您目前选择了" + rows.length + "条!");
				}
			}});
			
			
			//批量删除采购计划
			$("#equprcplan-delete").linkbutton({onClick:function(){
				//获取选中的行数
				var rows = $("#tb_equprcplan").datagrid("getSelections");
				if(rows.length > 0){
					$.messager.confirm("提示","确认删除？",function(v){
						if(v){
							//将编号保存到数组中
							var arr = [];
							for(var i = 0; i < rows.length ;i++){
								arr.push(rows[i].equPrcPlanId);
							}
							//用form提交
							$('<form>').form('submit', {
								url:'deleteBatchequproplan',
								onSubmit: function(param){
								    param.list = arr;
								},
								success:function(data){
								    var json = eval("(" + data + ")");
									$.messager.alert("提示", json.reason);
									$("#tb_equprcplan").datagrid("reload");
								}});
						}});
				}else{
					$.messager.alert("提示", "必须选择一行以上！");
				}
				
			}}); 
			
		});
		//刷新
		$(function(){
			$("#equprcplan-reload").linkbutton({onClick:function(){
				$("#tb_equprcplan").datagrid({
					url:'findEquipmentProcurementPlanByPage',
					method:'get'
				});
			}});
		});
		
		//单元格编辑
		$.extend($.fn.datagrid.methods, {
			//编辑单元格 
			editCell: function(jq,param){
				return jq.each(function(){
					var opts = $(this).datagrid('options');
					//获取列  
					var fields = $(this).datagrid('getColumnFields',true).concat($(this).datagrid('getColumnFields'));
					for(var i=0; i<fields.length; i++){
						var col = $(this).datagrid('getColumnOption', fields[i]);
						col.editor1 = col.editor;
						if (fields[i] != param.field){ //如果不是选中的单元格  editor置空  
							col.editor = null;
						}
					}
					$(this).datagrid('beginEdit', param.index);
					for(var i=0; i<fields.length; i++){
						var col = $(this).datagrid('getColumnOption', fields[i]);
						col.editor = col.editor1;
					}
				});
			}
		});
		
		var editIndex = undefined;
		function endEditing(){
			//如果为undefined的话，为真，说明可以编辑  
			if (editIndex == undefined){return true}
			//判断是否有开启编辑的行，如果有则把开户编辑的那行结束编辑  
			if ($('#tb_equprcplan').datagrid('validateRow', editIndex)){
				$('#tb_equprcplan').datagrid('endEdit', editIndex);// 触发 onAfterEdit  方法
				editIndex = undefined;
				return true;
			} else {
				return false;
			}
		}
		
		function onClickCell(index, field, data) {
	        if (endEditing()) {
	            $('#tb_equprcplan').datagrid('selectRow', index)
	                    .datagrid('editCell', { index: index, field: field, data: data });
	            editIndex = index;
	        }
	    }
		
		 function onAfterEdit(rowIndex, rowData, changes) {//  onAfterEdit rowData 本行数据 ，changes 发生改变的数据
		        for (change in changes) {
		            var temp = {};
		            temp[change] = changes[change];
		            temp["equPrcPlanId"] = rowData.equPrcPlanId;
		            temp["equTitle"] = rowData.equTitle; 
		            temp["equName"] = rowData.equName;
		            temp["equPlanStatus"] = rowData.equPlanStatus;
		            temp["equPeople"] = rowData.equPeople;
		            temp["equSettime"] = rowData.equSettime;
		            temp["equApprover"] = rowData.equApprover;
		            temp["equAppTime"] = rowData.equAppTime;
		            temp["equAppStatus"] = rowData.equAppStatus;
		            temp["equArrivalDate"] = rowData.equArrivalDate;
		        }
		    }
		  
		$(function(){
			$("#equpeo").combogrid({
				label:'制定人:', 
				editable: false,
				width:'200',
				labelWidth:'60',
				panelWidth: '300',
				panelHeight: '350',
				url:'findEmpByPage',
				pagination: true,
				pageSize: 10,
				pageList: [5, 10, 15, 20],
				idField: 'employeeName',
				textField: 'employeeName',
				columns:[[
							 {field:'employeeName',title:'姓名',width:90},
			                 {field:'depName',title:'部门',width:100},
			                 {field:'employeeJob',title:'职位',width:100}
	            		]]
			});
<<<<<<< HEAD
			
			$("#equa").combogrid({
				 label:'审批人:',
				 editable: false,
				 width:'200',
				 labelWidth:'60',
				 panelWidth: '300',
				 panelHeight: '350',
				 url:'findEmpByPage',
				 pagination: true,
				 pageSize: 10,
				 pageList: [5, 10, 15, 20],
				 idField: 'employeeName',
				 textField: 'employeeName',
				 columns:[[
							{field:'employeeName',title:'姓名',width:90},
				            {field:'depName',title:'部门',width:100},
				            {field:'employeeJob',title:'职位',width:100}
		            	]]
			});
			$("#editequpeo").combogrid({
				label:'制定人:', 
				editable: false,
				width:'200',
				labelWidth:'60',
				panelWidth: '300',
				panelHeight: '350',
				url:'findEmpByPage',
				pagination: true,
				pageSize: 10,
				pageList: [5, 10, 15, 20],
				idField: 'employeeName',
				textField: 'employeeName',
				columns:[[
							 {field:'employeeName',title:'姓名',width:90},
			                 {field:'depName',title:'部门',width:100},
			                 {field:'employeeJob',title:'职位',width:100}
	            		]]
			});
			
		});
		
		
	</script>
	<!-- 页面equprcplan表格 -->
	<table id="tb_equprcplan" class="easyui-datagrid" data-options="
			fitColumns: true,
			fit: true,
			pagination: true,
			rownumbers: true,
			url: 'findEquipmentProcurementPlanByPage',
			toolbar: '#toolbar_equprcplan',
			singleSelect: true,
			onClickCell:onClickCell,
			border: false,
			pageSize: 10, 	
			pageList: [5, 10, 15, 20]
			">
		<thead>
			<tr>
				<th data-options="field:'equPrcPlanId',width:'10%',align:'center',checkbox:true">器械采购计划ID</th>
				<th data-options="field:'equTitle',width:'10%',align:'center',editor:'text'">标题</th>
				<th data-options="field:'equName',width:'10%',align:'center',editor:'text'">器械名称</th>
				<th data-options="field:'equPlanStatus',width:'10%',align:'center',
						editor:{
						type:'combobox',
						options:{
						valueField:'label',
						textField:'value',
						editable: false,
						panelHeight: 'auto',
						data: [{label:'已制定',value:'已制定'},
							   {label:'未制定',value:'未制定'}]}
						}">状态</th>
				<th data-options="field:'equPeople',width:'10%',align:'center',editor:'combobox'">制定人</th>
				<th data-options="field:'equSettime',width:'10%',align:'center',editor:'datebox'">制定日期</th>
				<th data-options="field:'equApprover',width:'10%',align:'center',editor:'combobox'">审批人</th>
				<th data-options="field:'equAppTime',width:'10%',align:'center',editor:'datebox'">审批日期</th>
				<th data-options="field:'equAppStatus',width:'10%',align:'center',
						editor:{
						type:'combobox',
						options:{
						valueField:'label',
						textField:'value',
						panelHeight: 'auto',
						data: [{label:'已审批',value:'已审批'},
							   {label:'未审批',value:'未审批'},
							   {label:'待审批',value:'待审批'}]}
						}">审批状态</th>
				<th data-options="field:'equArrivalDate',width:'10%',align:'center',editor:'datebox'">到货日期</th>
			</tr>
		</thead>			
	</table>
	
	<!-- 工具栏  -->
	<div id="toolbar_equprcplan">
		<a id="equprcplan-add" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">制定采购计划</a>
		<a id="equprcplan-edit" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改采购计划</a>
		<a id="equprcplan-delete" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">批量删除</a>
		<input id="equprcplan-search" class="easyui-searchbox" data-options="prompt:'请输入审批状态'"></input>
		<a id="equprcplan-my" class="easyui-linkbutton" data-options="iconCls:'icon-man',plain:true">我的采购计划</a>
		<a id="equprcplan-reload" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-ok',plain:true" onclick="accept()">应用</a>
	</div>
	
	<!-- 制定计划窗口 -->
	<div id="win_addequprcplan" class="easyui-window" title="制定器械采购计划" data-options="
					collapsible:false,
					minimizable:false,
					maximizable:false,
					modal:true,
					iconCls:'icon-save', 
					closed: true" style="width:600px;height:250px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'north',border:false" style="padding:5px;">
					<form id="form_addequprcplan" action="addNewequproplan" method="post" >
						<table id="tables" style="background: rgb(236, 243, 255); padding: 10px; border-radius: 5px; width:100%;hight:80%">
							<tr style="float:center">
								<td><input id="equtitle" class="easyui-textbox" name="equTitle" data-options="label:'标题:', width:'200',labelWidth:'60'" /></td>
							</tr>
							<tr>
								<td><input id="equname" class="easyui-textbox" name="equName" data-options="label:'器械名称:', width:'200',labelWidth:'60'" /></td>
								<td><select id="equpeo"  name="equPeople"></select></td>								
							</tr>
							
							<tr>
								<td><select id="equas" class="easyui-combobox" name="equAppStatus" data-options="
												label:'审批状态:', 
												editable: false,
												width:'200',
												labelWidth:'60',
												valueField:'equAppStatus',
												textField:'tequAppStatus',
												panelHeight: 'auto'
												">
										<option value="已审批">已审批</option>
										<option value="未审批">未审批</option>	
										<option value="待审批">待审批</option></select>
								</td>
								<td><input id="equat" class="easyui-datebox" name="equAppTime" data-options="label:'审批日期:', width:'200',editable: false,labelWidth:'60'" /></td>
							</tr>
							<tr>
								<td><input id="equa" name="equApprover"/></td>
								<td><input id="equad" class="easyui-datebox" name="equArrivalDate" data-options="label:'到货日期:', width:'200',editable: false,labelWidth:'60'" /></td>
							</tr>
							<tr>
								<td><select id="equps" class="easyui-combobox" name="equPlanStatus" data-options="
												label:'状态:', 
												editable: false,
												width:'200',
												labelWidth:'60',
												panelHeight: 'auto'">
										<option value="已制定">已制定</option>
										<option value="未制定">未制定</option>
										</select>
								</td>
								<td><input id="equst" class="easyui-datebox" name="equSettime" data-options="label:'制定日期:', width:'200',editable: false,labelWidth:'60'" /></td>
							</tr>
						</table>
					</form>
				</div>
				<div data-options="region:'south',border:false" style="text-align:right;padding: 5px 0 0;hight:15%">
					<a id="btn_true" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" style="width:65px">确定</a>
					<a id="btn_close" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" style="width:65px">关闭</a>
					<a id="btn_reset" class="easyui-linkbutton" data-options="iconCls:'icon-undo'" style="width:65px">重置</a>
				</div>
			</div>
		</div>
		
		
		<!-- 修改采购计划窗口 -->
		<div id="win_editequprcplan" class="easyui-window" title="制定器械采购计划" data-options="
					collapsible:false,
					minimizable:false,
					maximizable:false,
					modal:true,
					iconCls:'icon-save', 
					closed: true" style="width:600px;height:250px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'north',border:false" style="padding:5px;">
					<form id="form_editequprcplan" action="addNewequproplan" method="post" >
						<table id="tables" style="background: rgb(236, 243, 255); padding: 10px; border-radius: 5px; width:100%;height:80%">
							<tr style="float:center">
								<td><input id="equprcplanid" class="easyui-textbox" name="equPrcPlanId" data-options="label:'计划ID:', width:'200',labelWidth:'60'" /></td>
								<td><input id="editequtitle" class="easyui-textbox" name="equTitle" data-options="label:'标题:', width:'200',labelWidth:'60'" /></td>
							</tr>
							<tr>
								<td><input id="editequname" class="easyui-textbox" name="equName" data-options="label:'器械名称:', width:'200',labelWidth:'60'" /></td>
								<td><select id="editequpeo" name="equPeople">
									</select></td>								
							</tr>
							<tr>
								<td><select id="editequas" class="easyui-combobox" name="equAppStatus" data-options="
												label:'审批状态:', 
												editable: false,
												width:'200',
												labelWidth:'60',
												valueField:'equAppStatus',
												textField:'tequAppStatus',
												panelHeight: 'auto'
												">
										<option value="已审批">已审批</option>
										<option value="未审批">未审批</option>	
										<option value="待审批">待审批</option></select>
								</td>
								<td><input id="editequat" class="easyui-datebox" name="equAppTime" data-options="label:'审批日期:', width:'200',editable: false,labelWidth:'60'" /></td>
							</tr>
							<tr>
								<td><input id="editequa" class="easyui-combogrid" name="equApprover" data-options="
												label:'审批人:',
				 editable: false,
				 width:'200',
				 labelWidth:'60',
				 panelWidth: '300',
				 panelHeight: '350',
				 url:'findEmpByPage',
				 pagination: true,
				 pageSize: 10,
				 pageList: [5, 10, 15, 20],
				 idField: 'employeeName',
				 textField: 'employeeName',
				 columns:[[
							{field:'employeeName',title:'姓名',width:90},
				            {field:'depName',title:'部门',width:100},
				            {field:'employeeJob',title:'职位',width:100}
		            	]]
												 " /></td>
=======
			$("#editequpeo").combogrid({
				label:'制定人:', 
				editable: false,
				width:'200',
				labelWidth:'60',
				panelWidth: '300',
				panelHeight: '350',
				url:'findEmpByPage',
				pagination: true,
				pageSize: 10,
				pageList: [5, 10, 15, 20],
				idField: 'employeeName',
				textField: 'employeeName',
				columns:[[
							 {field:'employeeName',title:'姓名',width:90},
			                 {field:'depName',title:'部门',width:100},
			                 {field:'employeeJob',title:'职位',width:100}
	            		]]
			});
			
			$("#equa").combogrid({
				 label:'审批人:',
				 editable: false,
				 width:'200',
				 labelWidth:'60',
				 panelWidth: '300',
				 panelHeight: '350',
				 url:'findEmpByPage',
				 pagination: true,
				 pageSize: 10,
				 pageList: [5, 10, 15, 20],
				 idField: 'employeeName',
				 textField: 'employeeName',
				 columns:[[
							{field:'employeeName',title:'姓名',width:90},
				            {field:'depName',title:'部门',width:100},
				            {field:'employeeJob',title:'职位',width:100}
		            	]]
			});
			$("#editequa").combogrid({
				 label:'审批人:',
				 editable: false,
				 width:'200',
				 labelWidth:'60',
				 panelWidth: '300',
				 panelHeight: '350',
				 url:'findEmpByPage',
				 pagination: true,
				 pageSize: 10,
				 pageList: [5, 10, 15, 20],
				 idField: 'employeeName',
				 textField: 'employeeName',
				 columns:[[
							{field:'employeeName',title:'姓名',width:90},
				            {field:'depName',title:'部门',width:100},
				            {field:'employeeJob',title:'职位',width:100}
		            	]]
			
		});
			
		
	});
		
		
	</script>
	<!-- 页面equprcplan表格 -->
	<table id="tb_equprcplan" class="easyui-datagrid" data-options="
			fitColumns: true,
			fit: true,
			pagination: true,
			rownumbers: true,
			url: 'findEquipmentProcurementPlanByPage',
			toolbar: '#toolbar_equprcplan',
			singleSelect: true,
			onClickCell:onClickCell,
			border: false,
			pageSize: 10, 	
			pageList: [5, 10, 15, 20]
			">
		<thead>
			<tr>
				<th data-options="field:'equPrcPlanId',width:'10%',align:'center',checkbox:true">器械采购计划ID</th>
				<th data-options="field:'equTitle',width:'13%',align:'center',editor:'text'">标题</th>
				<th data-options="field:'equName',width:'10%',align:'center',editor:'text'">器械名称</th>
				<th data-options="field:'equPlanStatus',width:'10%',align:'center',
						editor:{
						type:'combobox',
						options:{
						valueField:'label',
						textField:'value',
						editable: false,
						panelHeight: 'auto',
						data: [{label:'已制定',value:'已制定'},
							   {label:'未制定',value:'未制定'}]}
						}">状态</th>
				<th data-options="field:'equPeople',width:'8%',align:'center',editor:'combobox'">制定人</th>
				<th data-options="field:'equSettime',width:'10%',align:'center',editor:'datebox'">制定日期</th>
				<th data-options="field:'equApprover',width:'8%',align:'center',editor:'combobox'">审批人</th>
				<th data-options="field:'equAppTime',width:'10%',align:'center',editor:'datebox'">审批日期</th>
				<th data-options="field:'equAppStatus',width:'10%',align:'center',
						editor:{
						type:'combobox',
						options:{
						valueField:'label',
						textField:'value',
						panelHeight: 'auto',
						data: [{label:'已审批',value:'已审批'},
							   {label:'未审批',value:'未审批'},
							   {label:'待审批',value:'待审批'}]}
						}">审批状态</th>
				<th data-options="field:'equArrivalDate',width:'10%',align:'center',editor:'datebox'">到货日期</th>
			</tr>
		</thead>			
	</table>
	
	<!-- 工具栏  -->
	<div id="toolbar_equprcplan">
		<a id="equprcplan-add" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">制定采购计划</a>
		<a id="equprcplan-edit" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改采购计划</a>
		<a id="equprcplan-delete" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">批量删除</a>
		<input id="equprcplan-search" class="easyui-searchbox" data-options="prompt:'请输入审批状态'"></input>
		<a id="equprcplan-my" class="easyui-linkbutton" data-options="iconCls:'icon-man',plain:true">我的采购计划</a>
		<a id="equprcplan-reload" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-ok',plain:true" onclick="accept()">应用</a>
	</div>
	
	<!-- 制定计划窗口 -->
	<div id="win_addequprcplan" class="easyui-window" title="制定器械采购计划" data-options="
					collapsible:false,
					minimizable:false,
					maximizable:false,
					modal:true,
					iconCls:'icon-save', 
					closed: true" style="width:600px;height:250px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'north',border:false" style="padding:5px;">
					<form id="form_addequprcplan" action="addNewequproplan" method="post" >
						<table id="tables" style="background: rgb(236, 243, 255); padding: 10px; border-radius: 5px; width:100%;hight:80%">
							<tr style="float:center">
								<td><input id="equtitle" class="easyui-textbox" name="equTitle" data-options="label:'标题:', width:'200',labelWidth:'60'" /></td>
							</tr>
							<tr>
								<td><input id="equname" class="easyui-textbox" name="equName" data-options="label:'器械名称:', width:'200',labelWidth:'60'" /></td>
								<td><select id="equpeo"  name="equPeople"></select></td>								
							</tr>
							
							<tr>
								<td><select id="equas" class="easyui-combobox" name="equAppStatus" data-options="
												label:'审批状态:', 
												editable: false,
												width:'200',
												labelWidth:'60',
												valueField:'equAppStatus',
												textField:'tequAppStatus',
												panelHeight: 'auto'
												">
										<option value="已审批">已审批</option>
										<option value="未审批">未审批</option>	
										<option value="待审批">待审批</option></select>
								</td>
								<td><input id="equat" class="easyui-datebox" name="equAppTime" data-options="label:'审批日期:', width:'200',editable: false,labelWidth:'60'" /></td>
							</tr>
							<tr>
								<td><input id="equa" name="equApprover"/></td>
								<td><input id="equad" class="easyui-datebox" name="equArrivalDate" data-options="label:'到货日期:', width:'200',editable: false,labelWidth:'60'" /></td>
							</tr>
							<tr>
								<td><select id="equps" class="easyui-combobox" name="equPlanStatus" data-options="
												label:'状态:', 
												editable: false,
												width:'200',
												labelWidth:'60',
												panelHeight: 'auto'">
										<option value="已制定">已制定</option>
										<option value="未制定">未制定</option>
										</select>
								</td>
								<td><input id="equst" class="easyui-datebox" name="equSettime" data-options="label:'制定日期:', width:'200',editable: false,labelWidth:'60'" /></td>
							</tr>
						</table>
					</form>
				</div>
				<div data-options="region:'south',border:false" style="text-align:right;padding: 5px 0 0;hight:15%">
					<a id="btn_true" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" style="width:65px">确定</a>
					<a id="btn_close" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" style="width:65px">关闭</a>
					<a id="btn_reset" class="easyui-linkbutton" data-options="iconCls:'icon-undo'" style="width:65px">重置</a>
				</div>
			</div>
		</div>
		
		
		<!-- 修改采购计划窗口 -->
		<div id="win_editequprcplan" class="easyui-window" title="制定器械采购计划" data-options="
					collapsible:false,
					minimizable:false,
					maximizable:false,
					modal:true,
					iconCls:'icon-save', 
					closed: true" style="width:600px;height:250px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'north',border:false" style="padding:5px;">
					<form id="form_editequprcplan" action="addNewequproplan" method="post" >
						<table id="tables" style="background: rgb(236, 243, 255); padding: 10px; border-radius: 5px; width:100%;height:80%">
							<tr style="float:center">
								<td><input id="equprcplanid" class="easyui-textbox" name="equPrcPlanId" data-options="label:'计划ID:', width:'200',labelWidth:'60'" /></td>
								<td><input id="editequtitle" class="easyui-textbox" name="equTitle" data-options="label:'标题:', width:'200',labelWidth:'60'" /></td>
							</tr>
							<tr>
								<td><input id="editequname" class="easyui-textbox" name="equName" data-options="label:'器械名称:', width:'200',labelWidth:'60'" /></td>
								<td><select id="editequpeo" name="equPeople" ></select></td>								
							</tr>
							<tr>
								<td><select id="editequas" class="easyui-combobox" name="equAppStatus" data-options="
												label:'审批状态:', 
												editable: false,
												width:'200',
												labelWidth:'60',
												valueField:'equAppStatus',
												textField:'tequAppStatus',
												panelHeight: 'auto'
												">
										<option value="已审批">已审批</option>
										<option value="未审批">未审批</option>	
										<option value="待审批">待审批</option></select>
								</td>
								<td><input id="editequat" class="easyui-datebox" name="equAppTime" data-options="label:'审批日期:', width:'200',editable: false,labelWidth:'60'" /></td>
							</tr>
							<tr>
								<td><input id="editequa" name="equApprover" /></td>
>>>>>>> branch 'tgj' of https://git.oschina.net/xmw1995/HIS.SpringMVC.git
								<td><input id="editequad" class="easyui-datebox" name="equArrivalDate" data-options="label:'到货日期:', width:'200',editable: false,labelWidth:'60'" /></td>
							</tr>
							<tr>
								<td><select id="editequps" class="easyui-combobox" name="equPlanStatus" data-options="
												label:'状态:', 
												editable: false,
												width:'200',
												labelWidth:'60',
												panelHeight: 'auto'">
										<option value="已制定">已制定</option>
										<option value="未制定">未制定</option>
										</select>
									</td>
								<td><input id="editequst" class="easyui-datebox" name="equSettime" data-options="label:'制定日期:', width:'200',editable: false,labelWidth:'60'" /></td>
							</tr>
						</table>
					</form>
				</div>
				<div data-options="region:'south',border:false" style="text-align:right;padding: 5px 0 0;hight:15%">
					<a id="edit_true" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" style="width:65px">确定</a>
					<a id="edit_close" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" style="width:65px">关闭</a>
					<a id="edit_reset" class="easyui-linkbutton" data-options="iconCls:'icon-undo'" style="width:65px">重置</a>
				</div>
			</div>
		</div>
		
		
		
	<!-- 我的采购计划窗口 -->
	<!-- <div id="win_myequprcplan" class="easyui-window" title="我的采购计划" data-options="
					collapsible:false,
					minimizable:false,
					maximizable:false,
					modal:true,
					iconCls:'icon-save', 
					closed: true" style="width:80%;height:40%;padding:5px;">
			<table id="tb_myequprcplan" class="easyui-datagrid" data-options="
						url:'findEquipmentProcurementPlanByPage3',
						fitColumns:true,
						pagination: true,
						pageSize: 5,
						pageList: [5, 10, 15, 20],
						rownumbers: true,
						toolbar:'#tb2'
						">
				<thead>
					<tr>
						<th data-options="field:'equTitle',width:'10%',align:'center'">标题</th>
						<th data-options="field:'equPlanStatus',width:'10%',align:'center'">状态</th>
						<th data-options="field:'equPeople',width:'10%',align:'center'">制定人</th>
						<th data-options="field:'equSettime',width:'10%',align:'center'">制定日期</th>
						<th data-options="field:'equApprover',width:'10%',align:'center'">审批人</th>
						<th data-options="field:'equAppTime',width:'10%',align:'center'">审批日期</th>
						<th data-options="field:'equAppStatus',width:'10%',align:'center'">审批状态</th>
						<th data-options="field:'equArrivalDate',width:'10%',align:'center'">到货日期</th>
					</tr>
				</thead>
		</table>
		<div style="float:right">
			<a id="btnprint" class="easyui-linkbutton" data-options="iconCls:'icon-print'" style="width:65px">打印</a>
		</div>
	</div> -->
	
				
</body>
</html>
